-
Notifications
You must be signed in to change notification settings - Fork 15
Write metadata to a dedicated JSON file #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #737 +/- ##
==========================================
- Coverage 70.12% 69.65% -0.48%
==========================================
Files 106 107 +1
Lines 6822 6913 +91
==========================================
+ Hits 4784 4815 +31
- Misses 2038 2098 +60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
/run-gpu-tests |
@@ -84,8 +81,8 @@ function SolutionSavingCallback(; interval::Integer=0, dt=0.0, | |||
save_times=Float64[], | |||
save_initial_solution=true, save_final_solution=true, | |||
output_directory="out", append_timestamp=false, | |||
prefix="", verbose=false, write_meta_data=true, | |||
max_coordinates=Float64(2^15), custom_quantities...) | |||
prefix="", verbose=false, max_coordinates=Float64(2^15), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change!
@@ -216,6 +216,8 @@ function initialize_postprocess_callback!(cb::PostprocessCallback, u, t, integra | |||
# Apply the callback | |||
cb(integrator) | |||
|
|||
write_meta_data(cb, integrator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is called both by the postprocess and the savesolution callback? Do they both create the file and the second overwrites the first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they both create the file and the second overwrites the first?
Yes
src/io/io.jl
Outdated
(; systems) = semi | ||
|
||
output_directory = callback.output_directory | ||
prefix = hasproperty(callback, :prefix) ? callback.prefix : "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not clean. Why does the postprocess callback write this file anyway? This will mostly be used for restarting, no? Then it should be sufficient if only the saving callback writes this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One may start a simulation only with a postprocess callback without writing the solution.
So something like this:
|
* add sgs * update * fix * remove * fix doc * fix * fixes * typo * tpo * format * add explanation * adjust tests * add to validation setup for wcsph * review fixes * Update taylor_green_vortex_2d.jl * Update validation_taylor_green_vortex_2d.jl * Update dam_break_2d.jl * fix and add citations * add news * implement suggestions * format * rename viscosity * too much renaming * implement suggestions * Update validation_taylor_green_vortex_2d.jl * fix tests again --------- Co-authored-by: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Co-authored-by: Niklas Neher <73897120+LasNikas@users.noreply.github.com>
This PR adds the new function
trixi2json
, which exports simulation metadata to a dedicated JSON file at the start of the simulation. Previously, metadata was stored within the VTK output files. The structure and design ofwrite_json.jl
closely follow the existing implementation inwrite_vtk.jl
for consistency.This is what the JSON files looks like for the
hydrostatic_water_comun_2d.jl
example:boundary_1_metadata.json
:fluid_1_metadata.json
:Remark: Unit tests for this function will be added in a follow-up PR. In that upcoming PR, I will implement the functionality to read
meta_data
alongside the simulation data inread_vtk.jl
.